#ifndef SOLVER_HPP
# define SOLVER_HPP

# include <stack>
# include <queue>
# include <vector>
# include <unordered_map>

# include "Timer.hpp"
# include "Puzzle.hpp"
# include "AStarNode.hpp"
# include "IndexedPriorityQueue.h"

class Solver
{
public:
    Solver();
    virtual ~Solver();

    void aStar(Puzzle& p);

private:
    void _displaySolution();
    void _generateSolutionPath(AStarNode* n);
    void _insertChilds(AStarNode& p, Puzzle const & solution);

private:
    Timer _timer;
    int _nodeChecked;
    int _maxNodeLoaded;
    std::stack<AStarNode> _solutionPath;
    IndexedPriorityQueue<AStarNode> _openedList;
    std::unordered_map<AStarNode, int, HashNode> _closedList;
};

#endif // SOLVER_HPP
